package com.flipdf2.serialize.ppml;

public class PPMLException extends Exception {

	private static final long serialVersionUID = -3309852526925142046L;

	public static final int REQUIRED_ATTRIBUTE_LOST = 1;
	public static final int REQUIRED_ELEMENT_LOST = 2;
	
	private PPMLException(String message){
		super(message);
	}
	
	public static PPMLException getInstance(int type, String message) {
		if (type == REQUIRED_ATTRIBUTE_LOST) {
			return new PPMLException("not found required attribute: " + message);
		} else if (type == REQUIRED_ELEMENT_LOST){
			return new PPMLException("not found required element: " + message);
		}
		return new PPMLException(message);
	}
	
}
